import { BaseEntity } from '@cool-midway/core';
import { Column, Entity } from 'typeorm';

/**
 * 轮播图
 */
@Entity('app_banner')
export class BannerEntity extends BaseEntity {
    @Column({ comment: '图片', type: 'text' })
    image: string;

    @Column({ comment: '路径', nullable: true })
    url: string;

    @Column({ comment: '小程序appid', nullable: true })
    appid: string;

    @Column({ comment: '类型 event:触发事件 navigateTo:跳转页面 ToMiniProgram:跳转小程序', default: 'event', type: 'enum', enum: ['event', 'navigateTo', 'ToMiniProgram'] })
    type: string;

    @Column({ comment: '标题', nullable: true, default: '' })
    title: string;

    @Column({ comment: '文本', nullable: true, default: '' })
    text: string;

    @Column({ comment: '状态 0:禁用 1：启用', default: 1, type: 'tinyint' })
    status: number;
}
